//匹配文件后缀
export function matchFileSuffixType(fileName) {
    // 后缀获取
    var suffix = ''
        // 获取类型结果
    var result = ''
    try {
        var flieArr = fileName.split('.')
        suffix = flieArr[flieArr.length - 1]
    } catch (err) {
        suffix = ''
    }
    // fileName无后缀返回 false
    if (!suffix) {
        result = false
        return result
    }
    // 图片格式
    var imglist = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'tif', 'tiff']
        // 进行图片匹配
    result = imglist.some(function(item) {
        return item == suffix
    })
    if (result) {
        result = 'word'
        return result
    }
    // 匹配txt
    var txtlist = ['txt']
    result = txtlist.some(function(item) {
        return item == suffix
    })
    if (result) {
        result = 'txt'
        return result
    }
    // 匹配txt
    var txtlist = ['xlsx']
    result = txtlist.some(function(item) {
        return item == suffix
    })
    if (result) {
        result = 'txt'
        return result
    }

    // 匹配 doc
    var officelist = ['doc', 'docx']
    result = officelist.some(function(item) {
        return item == suffix
    })
    if (result) {
        result = 'word'
        return result
    }
    // 匹配 ppt
    var officelist = ['ppt', 'pptx']
    result = officelist.some(function(item) {
        return item == suffix
    })
    if (result) {
        result = 'ppt'
        return result
    }
    // 匹配 pdf
    var officelist = ['pdf']
    result = officelist.some(function(item) {
        return item == suffix
    })
    if (result) {
        result = 'pdf'
        return result
    }
    // 其他 文件类型
    result = 'word'
    return result


}